import request from '@/utlis/request.js';

export const userLoginService = (registerData) => {
    console.log("账号密码", registerData);
    return request.post('/user/login', registerData, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}
export const userLogoutService = () => {
    return request.post('/user/logout');
}
export const userAvatarUpdateService = (id) => {
    return request.put('/user/updateAvatar', { id })
}
export const uploadAvatarService = (data) => {
    return request.post('/user/updateAvatar', data)
}

export const getUserByIdService = (id) => {
    return request.get(`/user/${id}`)
}
export const editUserService = (data) => {
    return request.post('/user/edit', data)
}

export const UpdatePhoneService = (data) => {
    return request.post('/user/updatePhoneUsername', data)
}

export const resetPasswordService = (data) => {
    return request.post('/user/restPassword', data)
}

export const getRoleListService = () => {
    return request.get('/common/user/role')
}
export const getUserListService=()=>{
    return request.get('/common/user/userList')
}
export const getPenetrationSupervisorListService=()=>{
    return request.get('/common/user/penetrationSupervisor')
}

export const getProjectManagerListService=()=>{
    return request.get('/common/user/projectManager')
}

export const getPenetrationStaffListService=()=>{
    return request.get('/common/user/penetrationStaff')
}
export const getPenetrationManagerListService=()=>{
    return request.get('/common/user/penetrationManager')
}
export const delectUserService=(id)=>{
    return request.delete(`/user/${id}`)
}

export const addUserService=(data)=>{
    return request.post('/user/add',data)
}

export const resetUserPasswordService = (userId) => {
    return request.post('/user/restPassword', { userId })
}

